Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nv 2452 tenant create + update a tenant sidebar #3863

Merged

Conversation

ainouzgali
Copy link
Contributor

@ainouzgali ainouzgali commented Jul 27, 2023

What change does this PR introduce?

Create Tenant sidebar will be shown after clicking on the "Add a Tenant" button located on the Tenants list page.

Tests will be added in a separate PR.

Screen Shot 2023-07-27 at 10 39 16 Screen Shot 2023-07-27 at 10 39 43

Why was this change needed?

Other information (Screenshots)

@linear
Copy link

linear bot commented Jul 27, 2023

NV-2452 🏘️ [Tenant] Create a Tenant sidebar

What?

Create Tenant sidebar will be shown after clicking on the "Add a Tenant" button located on the Tenants list page.

Why? (Context)

We need to display a sidebar when creating a new tenant and collect its name and identifier

Definition of Done

  • By clicking Add a Tenant button the UI opens the Tenant creation sidebar on the right of the page
  • The title "Create a tenant" is displayed
  • Description of what the tenant is displayed under the title.
    • Don't display Learn more for the current cycle.

      Link to Learn more will be added next cycle as soon as we create a guideline for tenants in our docs.

  • Inputs for Name and identifier are displayed in the sidebar
  • The create button is disabled until a user specifies a name and identifier
  • Display hint on hover over disabled button Create
  • Tenant identifier must be unique, only alphabetical, dash
, or underscore characters
  • Tenant identifier field should be verified. The verification errors are displayed:
    • "The tenant with that identifier already exists in this environment."
    • "Only alphabetical, dash
, or underscore characters."
  • Cancel or X Close buttons will close the panel and cancel the creation
  • If a user fills in a name and Tenant identifier and then cancels the creation, the next time the user opens the creation dialogue we display the info he filled in before he closes the panel
  • Create a Tenant instance by clicking on the button Create
    • Hint: "The new tenant is created" is displayed
    • The tenant update sidebar of the new tenant is displayed right after the creation (A tenant update sidebar is a scope of another task)
    • The list of tenants should be refetched

Hint - Tenants (Figma)

Tenant list / Creation dialogue - Tenants (Figma)

…-2452-tenant-create-a-tenant-sidebar

# Conflicts:
#	apps/web/src/pages/tenants/components/list/TenantsList.tsx
Copy link
Contributor

@djabarovgeorge djabarovgeorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really great! :) left couple of question on place i was not sure and small race condition in the update page.

Do we need to store empty data object by default in the DB if the user did not provide custom data? maybe we could replace it with a placeholder?

Additionally, I noticed if the user deletes the empty object {} the create is not executed.

apps/api/src/app/tenant/dtos/create-tenant-request.dto.ts Outdated Show resolved Hide resolved
apps/web/src/api/tenants.ts Outdated Show resolved Hide resolved
@@ -14,6 +14,7 @@ export const inputStyles = (theme: MantineTheme) => {
},
input: {
minHeight: '50px',
borderRadius: '7px',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one won't break anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, all inputs should be with border-radius of 7px. But usually it was just the default from mantine

…-2452-tenant-create-a-tenant-sidebar

# Conflicts:
#	apps/web/src/pages/tenants/components/list/TenantsList.tsx
Copy link
Contributor

@djabarovgeorge djabarovgeorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

djabarovgeorge and others added 2 commits July 31, 2023 09:36
…rn-data-as-a-prop

fix: allow return 'data' as response prop
@ainouzgali ainouzgali merged commit a1f9d6c into stacked-tenants-support Jul 31, 2023
@ainouzgali ainouzgali deleted the nv-2452-tenant-create-a-tenant-sidebar branch July 31, 2023 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants